<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
		<title>Chart Data Manager</title>
	</head>
	<script type="text/javascript" src="../lib/jquery.js"></script>
	<script type="text/javascript" src="../lib/jquery.json.min.js"></script>
	<script type="text/javascript" src="../js/com/chartUtil.js"></script>
	<script type="text/javascript" src="../js/com/indicatorCalculation.js"></script>
	<script type="text/javascript" src="../js/com/chartDataManager.js"></script>
	<body>
		<div>
			<input type="text" id = "symbolsTxt"  style="width:800px"  />
			<input type= "button"  onclick="getIntradayData()" value="GetChartIntradayData">
			<input type="text" id = "infoTxt" style="width:800px" />
			<input type= "button"  onclick="getHisData()" value="GetChartHistoricalData">
			<input type="text" id = "fundamentTxt" style="width:800px" />
			<input type= "button"  onclick="getFundmentalData()" value="GetChartFundamentalData">
			<div style="width:100%" id = "resultTxt"></div>
		</div>
		<script type="text/javascript">
		var chartManager = new RTQ_ChartDataManager("3QH5K9Y2XG9UCM9QYD9N3X7410906170",{});
		chartManager.registerSymbol({symbol:"0P000002RH",exch:"126",ticker:"IBM",type:1});
		chartManager.registerSymbol({symbol:"0P000003MH",exch:"126",ticker:"MSFT",type:1});
		chartManager.registerSymbol({symbol:"0P000002HD",exch:"126",ticker:"GOOG",type:1});
		function getIntradayData(){
			var symbols = eval("("+document.getElementById("symbolsTxt").value+")");
			
			chartManager.getIntradayData(symbols,function(data){
				for(var i=0;i<data.length;i++){
					var price = data[i].price;
					var volume = data[i].volume;
				}
				document.getElementById("resultTxt").innerHTML=$.toJSON(data);
			});
		}
		function getHisData(){
			var symbolsStr = document.getElementById("infoTxt").value;
			var symbols = eval("("+symbolsStr+")");
			chartManager.getHistoricalData(symbols,"d",39008,40210,function(data){
				for(var i=0;i<data.length;i++){
					var price = data[i].price;
					var volume = data[i].volume;
				}
				document.getElementById("resultTxt").innerHTML=$.toJSON(data);
			});
		}
		function getFundmentalData(){
			var symbolsStr = document.getElementById("fundamentTxt").value;
			var symbols = eval("("+symbolsStr+")");
			chartManager.getFundamentalData(symbols,"d",39008,40210,function(data){
				document.getElementById("resultTxt").innerHTML=$.toJSON(data);
			});
		}
	</script>
	</body>
	
</html>
